<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/3.2.40/vue.global.js"></script>
</head>
<body>
    <div id="app">
        <input type="text" name="" id="" v-model="name">
        <input type="text" name="" id="" v-model="lastname">
        <div>{{funllname}}</div>
        <button @click="change">该</button>
    </div>
</body>
</html>
<script>
    const app = Vue.createApp({
        data(){
            return{
                name:'ming',
                lastname:'hong'
            }
        },
        computed:{
            // funllname(){
            //     return this.name + '' + this.lastname
            // }
            funllname:{
                get(){
                    return this.name + '' + this.lastname
                },
                set(val){
                    [this.name,this.lastname] = val.split(' ')
                }
            }
        },
        methods:{
            change(){
                return this.funllname = 'li si'
            }
        }
    }).mount('#app')
</script>